<template>
    <el-dialog
        :visible.sync="visible"
        :title="!dataForm.id ? '新增' : '编辑'"
        :close-on-click-modal="false"
        top="0"
    >
        <el-form
            :model="dataForm"
            :rules="dataRule"
            label-width="80px"
            @keyup.enter.native="dataFormSubmitHandle()"
        >
            <el-form-item prop="username" label="账号">
                <el-input v-model="dataForm.username"></el-input>
            </el-form-item>
            <el-form-item prop="username" label="密码">
                <el-input v-model="dataForm.username"></el-input>
            </el-form-item>
            <el-form-item prop="username" label="确认密码">
                <el-input v-model="dataForm.username"></el-input>
            </el-form-item>
            <el-form-item prop="status" label="状态">
                <el-radio v-model="dataForm.status" :label="0">禁用</el-radio>
                <el-radio v-model="dataForm.status" :label="1">启用</el-radio>
            </el-form-item>
        </el-form>
        <template slot="footer">
            <el-button @click="visible = false">取消</el-button>
            <el-button type="primary" @click="dataFormSubmitHandle()">保存</el-button>
        </template>
    </el-dialog>
</template>

<script>
export default {
    data() {
        return {
            visible: false,
            // 表单模板
            dataForm: {
                id: '',
                username: '',
                status: 1
            },
            dataRule: {}
        }
    },
    created() {},
    methods: {
        init() {
            this.visible = true
            //   this.$nextTick(() => {
            //     this.$refs['dataForm'].resetFields()
            //     this.roleIdListDefault = []
            //     Promise.all([
            //       this.getDeptList(),
            //       this.getRoleList()
            //     ]).then(() => {
            //       if (this.dataForm.id) {
            //         this.getInfo()
            //       }
            //     })
            //   })
        },
        dataFormSubmitHandle() {}
    },
    components: {}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped></style>
